package test.java;

import main.java.BLT.Carta;

import org.junit.Before;
import org.junit.Test;



public class testCarta {

	private Carta c;
	
	@Before
	public void Carta(){
	c = new Carta("Infantry",1);
	}
	
	@Test(expected=java.lang.IllegalArgumentException.class)
	public void TestConstructor1(){
		c= new Carta("Infantry",-1);
	}
	
	@Test(expected=java.lang.IllegalArgumentException.class)
	public void TestConstructor2(){
		c= new Carta("",1);
	}
	
	@Test(expected=java.lang.NullPointerException.class)
	public void TestConstructor3(){
		c= new Carta(null,1);
	}
	
	@Test
	public void TestConstructor4(){
		c= new Carta("Infantry,1");
		assert c.getNombre().equals("Infantry");
		assert c.getValor().equals(1);
	}
	
	@Test(expected=java.lang.IllegalArgumentException.class)
	public void TestConstructor5(){
		c= new Carta("Infantry,null");
	}
		
	@Test(expected=java.lang.IllegalArgumentException.class)
	public void TestConstructor6(){
		c= new Carta("Infantry,-1");
	}
	
	@Test
	public void TestSetValor(){
		c.setValor(3);
		assert c.getValor()==3;
	}
	
	@Test(expected=java.lang.IllegalArgumentException.class)
	public void TestSetValor1(){
		c.setValor(-3);
	}
	
	
}
